// javamaps
// Copyright (c) 2010 Lup Gratian
package Core;
import java.io.*;

public final class TileInfo implements Serializable {
    private ObjectId id_;
    private double x_;
    private double y_;
    private int zoomLevel_;

    /*
     * Constructori.
     */
    public TileInfo(ObjectId id, double x, double y) {
        id_ = id;
        x_ = x;
        y_ = y;
    }

    public TileInfo(ObjectId id, double x, double y, int zoomLevel) {
        this(id, x, y);
        zoomLevel_ = zoomLevel;
    }

    /*
     * Metode publice.
     */
    public ObjectId Id() { return id_; }
    public double X() { return x_; }
    public double Y() { return y_; }
    public int ZoomLevel() { return zoomLevel_; }

    @Override
    public boolean equals(Object obj) {
        if(obj == null) return false;
        if(this == obj) return true;
        if(this.getClass() != obj.getClass()) return false;

        TileInfo other = (TileInfo)obj;
        return id_.equals(other.id_);
    }

    @Override
    public int hashCode() {
        return id_.hashCode();
    }
}